﻿$(document).ready(
    function () {
        document.onkeydown = entersearch;
        $('#load').hide();
        $("#submit").click(function () {
            $('#load').show();
            var $e_ID = $("#e_ID").val();
            var $u_Password = $("#u_Password").val();
            $.ajax({
                url: "/Login/CheckLogin",
                type: "post",
                data: { "e_ID": $e_ID, "u_Password": $u_Password },
                success: function (msg) {
                    if (msg.state == "success") {
                        Messageshow("登陆成功等待页面跳转中!");
                        location = "/index/index";
                    }
                    else {
                        Messageshow("登陆失败");
                        //location = "/Login/index";
                    }
                    $('#load').hide();
                },
                error: function () {
                    $('#load').hide();
                    Messageshow("加载失败");
                }
            });
        });
        $("#clean").click(function () {
            $("#e_ID").val("");
            $("#u_Password").val("");
        });
    })
function entersearch() {
    var event = window.event || arguments.callee.caller.arguments[0];
    if (event.keyCode == 13) {
        $("#submit").click();
    }
}
function Messageshow(date) {
    var a = document.getElementById("Message");
    a.innerText = date;
    $('#myModal').modal('show');
}
//function ForgetPwd()
//{
//    $('#Emailform').modal('show');
//}
//function sendemail()
//{
//    $.ajax({
//        url: "/Login/CheckLogin",
//        type: "post",
//        data: { "e_ID": $e_ID, "u_Password": $u_Password },
//        success: function (msg) {
//            if (msg.state == "success") {
//                Messageshow("登陆成功");
//                location = "/index/index";
//            }
//            else {
//                Messageshow("登陆失败");
//                //location = "/Login/index";
//            }
//            $('#load').hide();
//        },
//        error: function () {
//            $('#load').hide();
//            Messageshow("加载失败");
//        }
//    });
//}